<template>
  <div class="child1">
    <h3>子组件1</h3>
    <h4>我的玩具数量：{{toyNum}}</h4>
    <h4>我的书籍数量：{{bookNum}}</h4>
    <button @click="test">干掉父亲一套房</button>
  </div>
</template>

<script>

export default {
  name: 'Child1',
  data() {
		return {
			toyNum:2,
      bookNum:100
		}
	},
  methods: {
    test(){
      this.$parent.houseNum -= 1
    }
  },
}
</script>

<style lang="less" scoped>
	.child1{
		background-color: orange;
		padding: 20px;
		border-radius: 10px;
    box-shadow: 0 0 10px black;
	}
</style>
